<!--
  @author yangjiangming
  @date 2018-12-11 14:32:39
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>工单详情</title>
    <th:block th:replace="common/common :: jscss"/>
    <link rel="stylesheet" href="/static/style/order/order.detail.css">
</head>
<body>
    <div class="work-detail" th:fragment="detail">
        <div class="layui-card">
            <div class="layui-card-body">
                <section>
                    <!--<h3>工单详情</h3>-->
                    <div class="detail-base-info">
                        <div class="layui-row">
                        <div class="layui-col-xs6 info-left">
                            <div class="grid-demo grid-demo-bg1">
                                <table class="layui-table table-info" lay-skin="nob" lay-size="lg">
                                    <colgroup>
                                        <col width="80">
                                        <col>
                                    </colgroup>
                                    <tbody>
                                        <tr>
                                            <td>工单号</td>
                                            <td>
                                                <span th:text="${entrustOrder.orderId}" id="code"></span>
                                                <a class="zmn-btn-text btn-copy" data-clipboard-target="#code">
                                                    <i class="zmn-icon zmn-icon-clipboard-in"></i>
                                                </a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>状态</td>
                                            <td>
                                                <span th:text="${entrustOrder.statusName}"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>用户姓名</td>
                                            <td th:text="|${entrustOrder.username}|"></td>
                                        </tr>
                                        <tr>
                                            <td>用户电话</td>
                                            <td th:text="|${entrustOrder.userPhone}|">

                                            </td>
                                        </tr>
                                        <tr>
                                            <td>地址</td>
                                            <td th:text="|${entrustOrder.provinceName} ${entrustOrder.cityName} ${entrustOrder.countyName} ${entrustOrder.userStreet} ${entrustOrder.userAddress}|"></td>
                                        </tr>
                                        <tr>
                                            <td>预约时间</td>
                                            <td>
                                                <span th:if="${entrustOrder.dutyTime != null}"
                                                      th:text="${#dates.format(entrustOrder.dutyTime, 'yy-MM-dd HH:mm:ss')}">
                                                </span>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="layui-col-xs6 info-right">
                            <div class="grid-demo">
                                <table class="layui-table table-info" lay-skin="nob" lay-size="lg">
                                    <colgroup>
                                        <col width="80">
                                        <col>
                                    </colgroup>
                                    <tbody>
                                        <tr>
                                            <td>工程师</td>
                                            <td>
                                                <span th:unless="${#strings.isEmpty(entrustOrder.masterName)}"
                                                      th:text="|${entrustOrder.masterName}-${entrustOrder.masterPhone}|"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>维修内容</td>
                                            <td>
                                                <span th:text="${entrustOrder.productInfo}"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>订单收入</td>
                                            <td>
                                                <span th:text="${#moneyUtil.parseToYuanStartWithUnit(entrustOrder.totalAmount)}"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>下单渠道</td>
                                            <td>
                                                <span th:text="${entrustOrder.channelName}"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>下单备注</td>
                                            <td>
                                                <span th:text="${entrustOrder.currentRemark}"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>录入人</td>
                                            <td>
                                                <span th:text="|${#strings.defaultString(entrustOrder.deptName, '')}-${#strings.defaultString(entrustOrder.creater, '')}|"></span>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    </div>
                </section>

                <section>
                    <h3>操作记录</h3>
                    <div class="layui-row">
                        <div class="layui-tab layui-tab-card" lay-filter="tabChange" id="log-tab">
                            <ul class="layui-tab-title">
                            </ul>
                            <div class="layui-tab-content">
                                <table class="layui-table table-log">
                                    <thead>
                                        <tr>
                                            <th width="130">操作时间</th>
                                            <th width="80">操作</th>
                                            <th>操作内容</th>
                                            <th width="150">状态变更</th>
                                            <th width="150">操作结果</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr th:each="log : ${entrustOrderSyncLogs}" th:data-type="${log.operateType}">
                                            <td th:text="${#dates.format(log.createTime, 'yy-MM-dd HH:mm:ss')}"></td>
                                            <td th:text="${log.operateTypeName}"></td>
                                            <td th:utext="${#stringUtil.replaceToBr(log.logRemark)}"></td>
                                            <td th:text="|${#strings.defaultString(log.beforeStatusName, '')}->${#strings.defaultString(log.afterStatusName, '')}|"></td>
                                            <td th:text="${#strings.defaultString(log.resultName, '')}"></td>
                                        </tr>
                                        <tr  class="no-data" th:styleappend="${#arrays.length(entrustOrderSyncLogs) > 0} ? 'display: none'">
                                            <td colspan="6" th:text="暂无操作记录" style="text-align: center"></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </section>
            </div>
        </div>
    </div>

    <script th:inline="javascript">
        var logs = [[${entrustOrderSyncLogs}]];

        layui.config({
            base: "/static/js/module/"
        }).extend({
            oms_entrust_work_detail: "entrust/work/zmn.oms.entrust.work.detail"
        }).use(['index', 'oms_entrust_work_detail']);
    </script>
</body>
</html>
